[Coading Test] 크기가 작은 부분 문자열

level : 1

Coading Test
Author

신호연

Published

January 9, 2023

문제

나의 풀이

def solution(t, p):
    t_len = len(t);p_len = len(p)
    answer = 0
    p = int(p)
    for idx in range(t_len-p_len+1):
        num = int(t[idx:idx+p_len])
        if num <= p:
            answer+=1
        else:
            pass
    return answer